Integrand size = 33, antiderivative size = 61 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+a \cos (c+d x)} \, dx=-\frac {A \text {arctanh}(\sin (c+d x))}{a d}+\frac {(2 A+C) \tan (c+d x)}{a d}-\frac {(A+C) \tan (c+d x)}{d (a+a \cos (c+d x))} \]
Leaf count is larger than twice the leaf count of optimal. \(229\) vs. \(2(61)=122\).
Time = 1.78 (sec) , antiderivative size = 229, normalized size of antiderivative = 3.75 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {4 \cos \left (\frac {1}{2} (c+d x)\right ) \cos ^2(c+d x) \left (C+A \sec ^2(c+d x)\right ) \left ((A+C) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+A \cos \left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {\sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )\right )}{a d (1+\cos (c+d x)) (2 A+C+C \cos (2 (c+d x)))} \]
(4*Cos[(c + d*x)/2]*Cos[c + d*x]^2*(C + A*Sec[c + d*x]^2)*((A + C)*Sec[c/2 ]*Sin[(d*x)/2] + A*Cos[(c + d*x)/2]*(Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/ 2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + Sin[d*x]/((Cos[c/2] - Sin [c/2])*(Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])))))/(a*d*(1 + Cos[c + d*x])*(2*A + C + C*Co s[2*(c + d*x)]))
Time = 0.52 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.02, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.242, Rules used = {3042, 3521, 3042, 3227, 3042, 4254, 24, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec ^2(c+d x) \left (A+C \cos ^2(c+d x)\right )}{a \cos (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )}dx\) |
\(\Big \downarrow \) 3521 |
\(\displaystyle \frac {\int (a (2 A+C)-a A \cos (c+d x)) \sec ^2(c+d x)dx}{a^2}-\frac {(A+C) \tan (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a (2 A+C)-a A \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^2}dx}{a^2}-\frac {(A+C) \tan (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {a (2 A+C) \int \sec ^2(c+d x)dx-a A \int \sec (c+d x)dx}{a^2}-\frac {(A+C) \tan (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a (2 A+C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx-a A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a^2}-\frac {(A+C) \tan (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {-\frac {a (2 A+C) \int 1d(-\tan (c+d x))}{d}-a A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a^2}-\frac {(A+C) \tan (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {\frac {a (2 A+C) \tan (c+d x)}{d}-a A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a^2}-\frac {(A+C) \tan (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {\frac {a (2 A+C) \tan (c+d x)}{d}-\frac {a A \text {arctanh}(\sin (c+d x))}{d}}{a^2}-\frac {(A+C) \tan (c+d x)}{d (a \cos (c+d x)+a)}\) |
-(((A + C)*Tan[c + d*x])/(d*(a + a*Cos[c + d*x]))) + (-((a*A*ArcTanh[Sin[c + d*x]])/d) + (a*(2*A + C)*Tan[c + d*x])/d)/a^2
3.1.44.3.1 Defintions of rubi rules used
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[a*(A + C)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(f*(b*c - a*d)*(2*m + 1))), x] + Simp[1/(b*(b*c - a*d)*(2*m + 1)) I nt[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[A*(a*c*(m + 1) - b*d*(2*m + n + 2)) - C*(a*c*m + b*d*(n + 1)) + (a*A*d*(m + n + 2) + C*(b* c*(2*m + 1) - a*d*(m - n - 1)))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)]
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 2.67 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.39
method | result | size |
parallelrisch | \(\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \cos \left (d x +c \right )-A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \cos \left (d x +c \right )+2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\left (A +\frac {C}{2}\right ) \cos \left (d x +c \right )+\frac {A}{2}\right )}{a d \cos \left (d x +c \right )}\) | \(85\) |
derivativedivides | \(\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {A}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {A}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d a}\) | \(92\) |
default | \(\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {A}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {A}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d a}\) | \(92\) |
risch | \(\frac {2 i \left (A \,{\mathrm e}^{2 i \left (d x +c \right )}+C \,{\mathrm e}^{2 i \left (d x +c \right )}+A \,{\mathrm e}^{i \left (d x +c \right )}+2 A +C \right )}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {A \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a d}-\frac {A \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a d}\) | \(118\) |
norman | \(\frac {\frac {\left (A +C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (A -C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (3 A +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {\left (5 A +C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a d}-\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a d}\) | \(166\) |
(A*ln(tan(1/2*d*x+1/2*c)-1)*cos(d*x+c)-A*ln(tan(1/2*d*x+1/2*c)+1)*cos(d*x+ c)+2*tan(1/2*d*x+1/2*c)*((A+1/2*C)*cos(d*x+c)+1/2*A))/a/d/cos(d*x+c)
Time = 0.28 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.79 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+a \cos (c+d x)} \, dx=-\frac {{\left (A \cos \left (d x + c\right )^{2} + A \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (A \cos \left (d x + c\right )^{2} + A \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left ({\left (2 \, A + C\right )} \cos \left (d x + c\right ) + A\right )} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right )^{2} + a d \cos \left (d x + c\right )\right )}} \]
-1/2*((A*cos(d*x + c)^2 + A*cos(d*x + c))*log(sin(d*x + c) + 1) - (A*cos(d *x + c)^2 + A*cos(d*x + c))*log(-sin(d*x + c) + 1) - 2*((2*A + C)*cos(d*x + c) + A)*sin(d*x + c))/(a*d*cos(d*x + c)^2 + a*d*cos(d*x + c))
\[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {\int \frac {A \sec ^{2}{\left (c + d x \right )}}{\cos {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\cos {\left (c + d x \right )} + 1}\, dx}{a} \]
(Integral(A*sec(c + d*x)**2/(cos(c + d*x) + 1), x) + Integral(C*cos(c + d* x)**2*sec(c + d*x)**2/(cos(c + d*x) + 1), x))/a
Leaf count of result is larger than twice the leaf count of optimal. 144 vs. \(2 (61) = 122\).
Time = 0.25 (sec) , antiderivative size = 144, normalized size of antiderivative = 2.36 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+a \cos (c+d x)} \, dx=-\frac {A {\left (\frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a - \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - \frac {C \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \]
-(A*(log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a - log(sin(d*x + c)/(cos(d* x + c) + 1) - 1)/a - 2*sin(d*x + c)/((a - a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)*(cos(d*x + c) + 1)) - sin(d*x + c)/(a*(cos(d*x + c) + 1))) - C*sin( d*x + c)/(a*(cos(d*x + c) + 1)))/d
Time = 0.28 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.66 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+a \cos (c+d x)} \, dx=-\frac {\frac {A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} - \frac {A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} + \frac {2 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a}}{d} \]
-(A*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - A*log(abs(tan(1/2*d*x + 1/2*c) - 1))/a - (A*tan(1/2*d*x + 1/2*c) + C*tan(1/2*d*x + 1/2*c))/a + 2*A*tan(1/ 2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^2 - 1)*a))/d
Time = 1.22 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.18 \[ \int \frac {\left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {2\,A\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {2\,A\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A+C\right )}{a\,d} \]